package jvm.string;

public class StringTest1 {
    public static void main(String[] args) {
        test1();
    }
    public static void test1() {
        String s1="通过字面量方式声明会放在在常量池中";
        System.out.println(s1.hashCode());//-1203778605
        s1=s1.replace("中","里");//String的不可变性
        System.out.println(s1.hashCode());//-1203761294
    }
}
